package com.zhanghaijun.createCode.Json.http;

import com.enniu.commons.util.JsonUtil;
import com.zhanghaijun.createCode.Json.bean.SmsCountResponseList;
import com.zhanghaijun.createCode.Json.bean.UniPayCountResultBean;
import com.zhanghaijun.createCode.util.JSONUtil;
import com.zhanghaijun.createCode.util.PrintUtil;
import org.jsoup.Connection;
import org.jsoup.Jsoup;

/**
 * Created by zhanghaijun on 15/6/4.
 */
public class HttpConnectionByJsoup {

    public static void main(String[] args) throws Exception{
//        String url="http://10.0.4.26:8080/vdata-data-portal/msggwinfo/statis?type=003";
//
//        String json = Jsoup.connect(url).ignoreContentType(true).timeout(30*1000).get().text();
//
//        PrintUtil.println(json);
//        SmsCountResponseList smsCountResponseList =(SmsCountResponseList)JsonUtil.objectFromJson(json,SmsCountResponseList.class);
//       // UniPayCountResultBean uniPayCountResultBean =(UniPayCountResultBean)JSONUtil.strToBean(json, UniPayCountResultBean.class);
//
//        PrintUtil.println("over");



        Connection loginConn = Jsoup.connect("https://ad1.51.nb/iisadmpwd/achg.asp").method(Connection.Method.POST).timeout(200).ignoreContentType(true);
        loginConn.data("acct", "zhanghaijun")
                 .data("old","1234567")
                 .data("new","123456")
                 .data("new2","123456");
        String json = loginConn.get().text();
        PrintUtil.println(json);


    }

}
